package srjava.messages;

import java.io.IOException;
import java.io.StringReader;

public class Elected extends Message {
	CordinatorInfo cordinatorInfo;

	public Elected() {
		this.msgType = MessageType.ELECTED;
		this.cordinatorInfo = new CordinatorInfo();
	}

	public Elected(CordinatorInfo cordinatorInfo) {
		this.msgType = MessageType.ELECTED;
		this.cordinatorInfo = cordinatorInfo;
	}

	public CordinatorInfo getCordinatorInfo() {
		return cordinatorInfo;
	}

	public void setCordinatorInfo(CordinatorInfo cordinatorInfo) {
		this.cordinatorInfo = cordinatorInfo;
	}

	@Override
	public String serialize() {
		String pom = super.serialize() + cordinatorInfo.serialize();
		return pom;
	}

	@Override
	public void deSerialize(StringReader s) throws IOException {
		cordinatorInfo.deSerialize(s);
	}
}
